﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameObjects;
using Virvar.Net;

namespace Network
{
    public class NetPlayer
    {
        static sbyte curId = 1;
        public sbyte PlayerId;
        public ushort MessageId = 1;
        public ushort Ack = 0;
        public IObjMessager Messager;
        public Character Character;
        /// <summary>
        /// Когда был получен последний пакет от игрока.
        /// </summary>
        public TimeSpan LastUpdate;

        public NetPlayer(IObjMessager messager, Character character)
        {
            this.PlayerId = curId++;
            this.Messager = messager;
            this.Character = character;
        }

        public NetPlayer(IObjMessager messager, Character character, TimeSpan createTime)
            : this(messager, character)
        {
            LastUpdate = createTime;
        }
    }
}
